3.17 \(\int \frac{\cos (x)}{-5+4 \sin (x)+\sin ^2(x)} \, dx\)

Optimal. Leaf size=21 \[ \frac{1}{6} \log (1-\sin (x))-\frac{1}{6} \log (\sin (x)+5) \]

[Out]

Log[1 - Sin[x]]/6 - Log[5 + Sin[x]]/6

________________________________________________________________________________________

Rubi [A]  time = 0.0276304, antiderivative size = 21, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3258, 616, 31} \[ \frac{1}{6} \log (1-\sin (x))-\frac{1}{6} \log (\sin (x)+5) \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]/(-5 + 4*Sin[x] + Sin[x]^2),x]

[Out]

Log[1 - Sin[x]]/6 - Log[5 + Sin[x]]/6

Rule 3258

Int[cos[(d_.) + (e_.)*(x_)]^(m_.)*((a_.) + (b_.)*((f_.)*sin[(d_.) + (e_.)*(x_)])^(n_.) + (c_.)*((f_.)*sin[(d_.
) + (e_.)*(x_)])^(n2_.))^(p_.), x_Symbol] :> Module[{g = FreeFactors[Sin[d + e*x], x]}, Dist[g/e, Subst[Int[(1
 - g^2*x^2)^((m - 1)/2)*(a + b*(f*g*x)^n + c*(f*g*x)^(2*n))^p, x], x, Sin[d + e*x]/g], x]] /; FreeQ[{a, b, c,
d, e, f, n, p}, x] && EqQ[n2, 2*n] && IntegerQ[(m - 1)/2]

Rule 616

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[b^2 - 4*a*c]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

\begin{align*} \int \frac{\cos (x)}{-5+4 \sin (x)+\sin ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{-5+4 x+x^2} \, dx,x,\sin (x)\right )\\ &=\frac{1}{6} \operatorname{Subst}\left (\int \frac{1}{-1+x} \, dx,x,\sin (x)\right )-\frac{1}{6} \operatorname{Subst}\left (\int \frac{1}{5+x} \, dx,x,\sin (x)\right )\\ &=\frac{1}{6} \log (1-\sin (x))-\frac{1}{6} \log (5+\sin (x))\\ \end{align*}

Mathematica [A]  time = 0.0471494, size = 30, normalized size = 1.43 \[ \frac{1}{6} \left (2 \log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )-\log (\sin (x)+5)\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]/(-5 + 4*Sin[x] + Sin[x]^2),x]

[Out]

(2*Log[Cos[x/2] - Sin[x/2]] - Log[5 + Sin[x]])/6

________________________________________________________________________________________

Maple [A]  time = 0.062, size = 16, normalized size = 0.8 \begin{align*}{\frac{\ln \left ( -1+\sin \left ( x \right ) \right ) }{6}}-{\frac{\ln \left ( 5+\sin \left ( x \right ) \right ) }{6}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/(-5+4*sin(x)+sin(x)^2),x)

[Out]

1/6*ln(-1+sin(x))-1/6*ln(5+sin(x))

________________________________________________________________________________________

Maxima [A]  time = 0.956759, size = 20, normalized size = 0.95 \begin{align*} -\frac{1}{6} \, \log \left (\sin \left (x\right ) + 5\right ) + \frac{1}{6} \, \log \left (\sin \left (x\right ) - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(-5+4*sin(x)+sin(x)^2),x, algorithm="maxima")

[Out]

-1/6*log(sin(x) + 5) + 1/6*log(sin(x) - 1)

________________________________________________________________________________________

Fricas [A]  time = 1.38426, size = 61, normalized size = 2.9 \begin{align*} -\frac{1}{6} \, \log \left (\sin \left (x\right ) + 5\right ) + \frac{1}{6} \, \log \left (-\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(-5+4*sin(x)+sin(x)^2),x, algorithm="fricas")

[Out]

-1/6*log(sin(x) + 5) + 1/6*log(-sin(x) + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.232809, size = 15, normalized size = 0.71 \begin{align*} \frac{\log{\left (\sin{\left (x \right )} - 1 \right )}}{6} - \frac{\log{\left (\sin{\left (x \right )} + 5 \right )}}{6} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(-5+4*sin(x)+sin(x)**2),x)

[Out]

log(sin(x) - 1)/6 - log(sin(x) + 5)/6

________________________________________________________________________________________

Giac [A]  time = 1.12437, size = 23, normalized size = 1.1 \begin{align*} -\frac{1}{6} \, \log \left (\sin \left (x\right ) + 5\right ) + \frac{1}{6} \, \log \left (-\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(-5+4*sin(x)+sin(x)^2),x, algorithm="giac")

[Out]

-1/6*log(sin(x) + 5) + 1/6*log(-sin(x) + 1)